package com.nhim.cms.admin.server;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.nhim.cms.domain.CustomWidgetPropertyValue;
import com.nhim.cms.util.CustomWidgetPropertyValueManager;
import com.nhim.core.AppContext;

@Service("CustomWidgetPropertyValueService")
public class CustomWidgetPropertyValueService {
	
	static Logger logger = Logger
	.getLogger(CustomWidgetInstanceService.class);
	
	public static CustomWidgetPropertyValue persit(CustomWidgetPropertyValue cwProperty)
	{
		try {
			return CustomWidgetPropertyValueManager
			.getFromApplicationContext(AppContext.getApplicationContext()).saveOrUpdate(cwProperty);
		} catch (Exception e) {
			logger.error(e.getMessage());
		}
		return null;
	
	}
	public static List<CustomWidgetPropertyValue> findByCustomWidgetInstanceId(Integer id)
	{
		 return CustomWidgetPropertyValueManager
		.getFromApplicationContext(AppContext.getApplicationContext()).findByCustomWidgetInstanceId(id);
		
	}
}
